package semantica;

import intermedia.Attributes;
import intermedia.InvalidTypeAttributeException;

public class SymbolTable {

	private Attributes nodeSymbols;
	private Attributes edgeSymbols;
	private Attributes graphSymbols;

	public SymbolTable() {
		nodeSymbols = new Attributes();
		edgeSymbols = new Attributes();
		graphSymbols = new Attributes();
	}

	public void addNodeAttribute(String node, String key, String val, int line, int column) throws InvalidTypeAttributeException {
		nodeSymbols.addAtribute(key, val, line, column);
	}

	public void addEdgeAttribute(String edge, String key, String val, int line, int column) throws InvalidTypeAttributeException {
		edgeSymbols.addAtribute(key, val, line, column);
	}

	public void addGraphAttribute(String key, String val, int line, int column) throws InvalidTypeAttributeException {
		graphSymbols.addAtribute(key, val, line, column);
	}

	public Attributes getNodeAttributes() {
		return nodeSymbols;
	}

	public Attributes getEdgeAttributes() {
		return edgeSymbols;
	}

	public void addGraphAttributes(Attributes attr) {

		graphSymbols.addAtributes(attr);

	}

	public void addEdgeAttributes(Attributes attr) {

		edgeSymbols.addAtributes(attr);

	}

	public void addNodeAttributes(Attributes attr) {

		nodeSymbols.addAtributes(attr);

	}

	public Attributes getGraphAttributes() {
		return graphSymbols;
	}

}
